package com.zwan.oam_rtc.utils.messages;

import com.zwan.oam_rtc.utils.wintcp.ByteTransfer;

import java.nio.ByteBuffer;


public class ResponseMessage extends AbstractStruct {
    

    private byte[] result = new byte[4];
    private byte[] agentnumber = new byte[29];

    private static int LENGTH = 34;


    public void setResult(String result) {
    	ByteTransfer.str2Byte(result, this.result);
    }

    public void setAgentnumber(String agentnumber) {
        ByteTransfer.str2Byte(agentnumber, this.agentnumber);
    }

    @Override
    public void writeToBuffer(ByteBuffer bf) {
        bf.put(result);
        bf.put(agentnumber);
    }

    @Override
    public void readFromBuffer(ByteBuffer bf) {
        bf.get(result);
        bf.get(agentnumber);
    }

    @Override
    public int getLength() {
        return LENGTH;
    }

}
